import React from 'react';
import { Switch, Route, NavLink } from "react-router-dom";
import routes from "../core/routes";

const App = () => {
  return (
    <div>
      <ul>
        <li>
          <NavLink to="/">home</NavLink>
        </li>
        <li>
          <NavLink to="/user">user</NavLink>
        </li>
      </ul>
      <Switch>
        { routes.map(route => (
          <Route
            key={route.path}
            {...route}
          />
        )) }
      </Switch>
    </div>
  )
}

export default App